//
//  MyTableViewCell.m
//  dongdongbook
//
//  Created by yaotd-PC on 2018/2/7.
//  Copyright © 2018年 yaotengdong. All rights reserved.
//

#import "MyTableViewCell.h"

@implementation MyTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.myImageviewOne = [[UIImageView alloc] init];
        [self.contentView addSubview: _myImageviewOne];
        
        _myLable = [[UILabel alloc] init];
        [self.contentView addSubview:_myLable];
        
        self.myImageviewSecond = [[UIImageView alloc] init];
        [self.contentView addSubview: _myImageviewSecond];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
#define cellwidth self.contentView.frame.size.width
#define cellheight self.contentView.frame.size.height
//    frame
    _myImageviewOne.frame = CGRectMake(5,cellheight / 2 - 8, 16, 16);
//    NSLog(@"x = %dwidth = %d", _myImageviewOne.frame.origin.x, _myImageviewOne.frame.size.width);
    _myLable.frame = CGRectMake(20 + _myImageviewOne.frame.origin.x + _myImageviewOne.frame.size.width, 5, cellheight * 3 - 10 * 3, cellheight - 10);
    _myImageviewSecond.frame = CGRectMake(cellwidth - 16 - 8, cellheight / 2 - 8, 16, 16);
    
}

@end
